package com.htht.smartschool.common.dao;

import java.util.HashMap;

import com.htht.smartschool.util.config.DBConfig;


/**
 * 数据库用户管理类
 * 用来设置/获取不同的数据库用户
 * @author smartschool
 *
 */
@SuppressWarnings("rawtypes")
public class DataBaseManager extends HashMap {

	private static final long serialVersionUID = 6491666983237498097L;
	private static DataBaseManager inst = null;

	private DataBaseManager() {

	}

	public static DataBaseManager getInst() {
		if (inst == null) {
			inst = new DataBaseManager();
			SessionManager hibernate1 = new SessionManager("hibernate.cfg.xml");
			inst.put(DBConfig.smartschool, hibernate1);
			System.out.println("==加载配置,初始化数据库连接...==");
		}
		return inst;
	}

	public SessionManager get(Object key) {
		return (SessionManager) super.get(key);
	}

	@SuppressWarnings("unchecked")
	@Override
	public Object put(Object key, Object value) {
		return super.put(key, value);
	}
	 
}
